home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 3 / Amiga Format CD03 (1996-07-04)(Future Publishing)(GB)(Track 1 of 6)[!][issue 1996-08].iso / comms / netsoftware / nethandler.lha / NetHandler / channel.h < prev    next >
C/C++ Source or Header  |  1989-09-16  |  2KB  |  83 lines

  1.  
  2. /*
  3.  *  CHANNEL.H
  4.  *
  5.  *  DNET (c)Copyright 1988, Matthew Dillon, All Rights Reserved.
  6.  *
  7.  *  Channel structures for SCMD_* channel commands.
  8.  */
  9.  
  10. #ifndef DNET_H
  11. typedef unsigned char ubyte;
  12. typedef unsigned short uword;
  13. typedef unsigned long ulong;
  14. typedef struct MsgPort PORT;
  15. typedef struct IOStdReq IOR;
  16. #endif
  17.  
  18. #define CSWITCH struct _CSWITCH
  19. #define COPEN    struct _COPEN
  20. #define CCLOSE    struct _CCLOSE
  21. #define CACKCMD struct _CACKCMD
  22. #define CEOFCMD struct _CEOFCMD
  23. #define CIOCTL    struct _CIOCTL
  24.  
  25. CSWITCH {        /*  SWITCH current data channel */
  26.     ubyte   chanh;
  27.     ubyte   chanl;
  28. };
  29.  
  30. COPEN {         /*  OPEN port on channel    */
  31.     ubyte   chanh;
  32.     ubyte   chanl;
  33.     ubyte   porth;
  34.     ubyte   portl;
  35.     ubyte   error;    /*  error return 0=ok        */
  36.     ubyte   pri;
  37. };
  38.  
  39. CCLOSE {        /*  CLOSE a channel        */
  40.     ubyte   chanh;
  41.     ubyte   chanl;
  42. };
  43.  
  44. CACKCMD {        /*  Acknowledge an open/close        */
  45.     ubyte   chanh;
  46.     ubyte   chanl;
  47.     ubyte   error;    /*  ERETRY ENOPORT ECLOSE1 ECLOSE2  */
  48.     ubyte   filler;
  49. };
  50.  
  51. CEOFCMD {        /*  Send [R/W] EOF        */
  52.     ubyte   chanh;
  53.     ubyte   chanl;
  54.     ubyte   flags;
  55.     ubyte   filler;
  56. };
  57.  
  58. CIOCTL {
  59.     ubyte   chanh;    /* channel            */
  60.     ubyte   chanl;
  61.     ubyte   cmd;    /* ioctl command        */
  62.     ubyte   valh;    /* ioctl value            */
  63.     ubyte   vall;
  64.     ubyte   valaux;    /* auxillary field        */
  65. };
  66.  
  67. #define CIO_SETROWS    1    /* PTY's only                   */
  68. #define CIO_SETCOLS    2    /* PTY's only                   */
  69. #define CIO_STOP    3    /* any channel, flow control    */
  70. #define CIO_START    4    /* any channel, flow control    */
  71. #define CIO_FLUSH    5
  72.  
  73. #define CHAN    struct _CHAN
  74.  
  75. CHAN {
  76.     PORT    *port;
  77.     IOR     *ior;
  78.     ubyte   state;
  79.     ubyte   flags;
  80.     char    pri;    /*  transmit priority    */
  81. };
  82.  
  83.